<?php
/**
 * Description of ValidateMinLength
 *
 * @author Damiano Ciarla
 */
class ValidateMinLength implements Validate
{
	public function validate($field, $value, $condition = null)
	{
		if(!is_null($value))
			if(empty($value) || strlen($value) < $condition)
				return TD_("Il campo", "validator") . " <b><u>" . ucfirst($field) . "</u></b> " . TD_("deve avere una lunghezza minima di", "validator") . " " . $condition . " caratteri";

		return true;
	}
}
?>
